#ifndef PROTOCOL_H
#define PROTOCOL_H
#include<iostream>
#include<stdlib.h>
#include<string.h>
#include<numeric>
#include<QObject>
typedef unsigned long myuint;
struct UserAccoutInfo
{
    qlonglong _id;
    QString _UserName;
    QString _Pwd;
    qlonglong _OnlineStatus;
    QString _Etc;
};
enum MSG_TYPE
{
    MSG_TYPE_MIN=0,
    MSG_TYPE_USER_REGISER_REQUEST,   //注册请求
    MSG_TYPE_USER_REGISER_RESPOND,   //注册回复
    MSG_TYPE_USER_LOGIN_REQUEST,     //登录请求
    MSG_TYPE_USER_LOGIN_RESPOND,     //登录回复
    MSG_TYPE_SEARCH_ONLINE_REQUEST,  //寻找在线请求
    MSG_TYPE_SEARCH_ONLINE_RESPOND,  //寻找在线回复
    MSG_TYPE_ALLNET_SCAN_ALL_REQUEST,//全查找请求
    MSG_TYPE_ALLNET_SCAN_ALL_RESPOND,//全查找回复
    MSG_TYPE_ADD_FRIEND_REQUEST,     //添加好友请求
    MSG_TYPE_ADD_FRIEND_RESPOND,     //添加好友回复
    MSG_TYPE_FRIEND_INFORM_PULL_REQUEST,    //好友通知拉取请求
    MSG_TYPE_FRIEND_INFORM_PULL_RESPOND,    //好友通知拉取回复
    MSG_TYPE_GROUP_INFORM_PULL_REQUEST,     //加群通知拉取请求
    MSG_TYPE_GROUP_INFORM_PULL_RESPOND,     //加群通知拉取回复
    MSG_TYPE_PULL_FRIEND_LIST_REQUEST,      //好友列表拉取请求
    MSG_TYPE_PULL_FRIEND_LIST_RESPOND,      //好友列表拉取回复
    MSG_TYPE_USER_DELETE,
    MSG_TYPE_MAX=LLONG_MAX
};

enum FRIEND_REQUEST_STATUS{
    FRIEND_REQUEST_STATUS_NULL=0,
    FRIEND_REQUEST_STATUS_WAIT_DEAL,
    FRIEND_REQUEST_STATUS_AGREE,
    FRIEND_REQUEST_STATUS_RUFUSE,
};

enum FRIEND_DIVIDE{
    FRIEND_ERROR=0,
    FRIEND_FREIND,
    FRIEND_PARENT,
};
typedef struct PDU
{
    myuint PDULength;
    myuint MessageType;
    myuint Status;
    char caData[128];
    char tagInfo[128];
    myuint MsgLength;
    int msgData[];
}PDU;
PDU *get_PDU(myuint size);
#endif // PROTOCOL_H
